<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>其他监理工作--监理通知form</title>

    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/style.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--extended-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--公用样式JS-->
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.boot.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
    <script type="text/javascript" src="${re.contextPath}/pageoffice.js" id="po_js_main"></script>
</head>
<style>
    .windows {
        background-color: #f8f8f8;
    }

    .popUp {
        width: 90%;
    }

</style>

<body>
<div class="windows">
    <div class="popUp whitebg">
        <div class="popUpTitle ft24 bold">监理通知</div>
        <div class="clearfix mt10">
            <span class="fl">SDZZ-QR009</span>
            <span class="fr">编号：JLTZ-${orderCode}</span>
        </div>
        <div class="popUpBox book">
            <form action="" class="layui-form addform">
                <div class="popUpBox">
                    <table>
                        <tr>
                            <td style="border: 1px solid #CCCCCC;width: 20%;">工程名称</td>
                            <td  colspan="3" style="border: 1px solid #CCCCCC;width: 40%;">
                                <input type="hidden" name="spfPrjid" value="${spf_prjid}">
                                <input type="hidden" name="fileInd" value="${ind}">
                                <input type="hidden" name="spfStaid" value="${spf_staid}">
                                <input type="hidden" name="spfMilid" value="${spf_milid}">
                                <input type="hidden" name="projectName" value="${pdto.projectName}">
                                <input type="hidden" name="spfFilecode" value="${spfFilecode}">
                                <input type="hidden" name="bfcId" value="45">
                                <input type="hidden" name="orderCode" value="${orderCode}">
                                <input type="hidden" name="fbCode" value="${fbCode}">
                                <input type="hidden" name="pcId" value="${pcId}">
                                <input type="hidden" name="spfF30"  id="spfF30">
                                <input type="hidden" name="wjNum" value="11">
                                <input type="text" name="spfF1" id="spfF1" value="${pdto.projectName}"
                                       lay-verify="spfF1"
                                       style="width: 100%;">
                                <#list listcjlist as vo>
                                    <input class="cjlist"  type="hidden" value="${vo.projectManager}" name="${vo.unitConstruction}">
                                </#list>
                            </td>
                        </tr>
                        <tr>
                            <td>业主单位</td>
                            <td colspan="3"><input type="text" name="spfF2" lay-verify="spfF2"
                                                   value="${pdto.owerCompany}"></td>

                        </tr>
                        <tr>
                            <td>监理单位</td>
                            <td colspan="3"><input type="text" name="spfF3" lay-verify="spfF3"
                                                   value="${pdto.supervisorCompanyName}"></td>
                        </tr>
                        <tr>
                            <td>承建单位</td>
                            <td colspan="3">
                                <div class="slt" id="cj"></div>
                            </td>
                        </tr>
                        <tr>
                            <td>致</td>
                            <td colspan="3">
                                <input  type="text" name="spfF5"  id="spfF5" lay-verify="spfF5" placeholder="[（承建单位）]">
                            </td>
                        </tr>
                        <tr>
                            <td>事由</td>
                            <td colspan="3">
                                <textarea name="spfF6" lay-verify="spfF6" >[因……，对工程工期/质量造成影响]
                                </textarea>
                            </td>
                        </tr>
                        <tr>
                            <td>内容</td>
                            <td colspan="3">
                                <textarea name="spfF7" lay-verify="spfF7">[鉴于以上原因，责令承建单位对……整改，于……以前达到/完成……标准/内容]
                                </textarea>
                            </td>
                        </tr>

                    </table>
                </div>
                <div class="popUpBtn center">
                    <button type="button" class="blue bgnone close">关闭</button>
                    <button type="button" class="bluebg white" lay-submit lay-filter="submit">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
<#-- 可以多选的下拉框 -->
<script src="${re.contextPath}/plugin/layui/xm-select.js"></script>

<script>
    var layer;
    var form;
    var laydate;
    var _xst;
    layui.use(['form', 'laydate', 'layer'], function () {
        layer = layui.layer;
        form = layui.form;
        laydate = layui.laydate;
        selectInnit();
        // 表单校验
        //$('form').initVerify(form);
        //监听提交
        form.on('submit(submit)', function (data) {
             var value= _xst.getValue('valueStr');
            var name= _xst.getValue('nameStr');
            if(!value){
                layer.msg("请选择承建单位！", {icon: 2});
                return ;
            }
            if(!name){
                layer.msg("请选择承建单位！", {icon: 2});
                return ;
            }
            data.field.spfF4=name;
            data.field.spfF30=value;
            layerAjax('/supervisor/projectManager/addFormFile', data.field, '', function (d) {
                if (d.flag == true) {

                    var spfId = d.data.spfId;// fmid
                    var fpid = d.data.fpid;// fpid
                    POBrowser.openWindowModeless('/sys/office/openword?ft=2&fmid=' + spfId + '&fpid=' + fpid, 'width=1200px;height=800px;', '{}')
                } else {
                    layer.msg(d.msg, {icon: 2});
                }
                console.log(d);
            });
            return false;

        });

        $('.close').click(function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        form.render();
    });

   function selectInnit(){
       _gpakgs = [];
       $(".cjlist").each(function (i, v) {
           var value= $(v).attr("value");
           var name= $(v).attr("name");
           _gpakgs.push({name: name, value: value});
       });
       _xst = xmSelect.render({
            el: '#cj',
            name: 'cj',
            radio:true,
            layVerify: false,
            toolbar: {show: true},
             on({ arr, item, selected }){
                if(arr.length>0){
                    $("#spfF5").val(arr[0].name);
                }

            },
            layVerType: 'msg',
            data: _gpakgs,
            strict: true
        });
    }

</script>


<!-- 底部结束 -->
</body>
</html>
